package org.jeecg.modules.test.component.mq;

import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.constant.RabbitMqConstant;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.stereotype.Service;

/**
 * RabbitMq消息接收
 *
 * @author ZhangYu
 * @date 2023/9/24 23:45
 */
@Slf4j
@Service
public class RabbitMqMessageReceive {

    /**
     * 测试队列一接收消息
     *
     * @param object 信息
     */
    @RabbitListener(queues = RabbitMqConstant.TEST_QUEUE_ONE)
    public void queueOneReceive(Object object) {
        log.info("----------------------------------------------------------------------从[测试队列一]接收消息：{}", object);
    }

    /**
     * 测试队列二接收消息
     *
     * @param object 信息
     */
    @RabbitListener(queues = RabbitMqConstant.TEST_QUEUE_TWO)
    public void queueTwoReceive(Object object) {
        log.info("----------------------------------------------------------------------从[测试队列二]接收消息：{}", object);
    }

}
